package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * CertificateAssciation entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Certificate_Assciation", schema = "dbo", catalog = "StudentManager")
public class CertificateAssciation implements java.io.Serializable {

	// Fields

	private Long certificateAssciationId;
	private Student student;
	private CertificateType certificateType;
	private Timestamp certificateTime;

	// Constructors

	/** default constructor */
	public CertificateAssciation() {
	}

	/** minimal constructor */
	public CertificateAssciation(Long certificateAssciationId) {
		this.certificateAssciationId = certificateAssciationId;
	}

	/** full constructor */
	public CertificateAssciation(Long certificateAssciationId, Student student,
			CertificateType certificateType, Timestamp certificateTime) {
		this.certificateAssciationId = certificateAssciationId;
		this.student = student;
		this.certificateType = certificateType;
		this.certificateTime = certificateTime;
	}

	// Property accessors
	@Id
	@Column(name = "Certificate_Assciation_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getCertificateAssciationId() {
		return this.certificateAssciationId;
	}

	public void setCertificateAssciationId(Long certificateAssciationId) {
		this.certificateAssciationId = certificateAssciationId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Student_id")
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Certificate_Type_id")
	public CertificateType getCertificateType() {
		return this.certificateType;
	}

	public void setCertificateType(CertificateType certificateType) {
		this.certificateType = certificateType;
	}

	@Column(name = "Certificate_Time", length = 23)
	public Timestamp getCertificateTime() {
		return this.certificateTime;
	}

	public void setCertificateTime(Timestamp certificateTime) {
		this.certificateTime = certificateTime;
	}

}